function showAddAddressForm() {
    document.getElementById('add-address-form').style.display = 'block';
}

function showAddProductForm() {
    document.getElementById('add-product-form').style.display = 'block';
}

function clearCart() {
    alert('购物车已清空');
}

document.addEventListener('DOMContentLoaded', () => {
    // 收货地址列表
    const addressList = document.getElementById('address-list');
    const addresses = [{id: 1, address: '地址1'}, {id: 2, address: '地址2'}]; // 示例数据
    addresses.forEach(addr => {
        const li = document.createElement('li');
        li.textContent = addr.address;
        addressList.appendChild(li);
    });

    // 商品列表
    const productList = document.getElementById('product-list');
    const products = [{id: 1, name: '商品1', price: '100.00'}, {id: 2, name: '商品2', price: '200.00'}]; // 示例数据
    products.forEach(prod => {
        const li = document.createElement('li');
        li.textContent = `${prod.name} - ￥${prod.price}`;
        productList.appendChild(li);
    });

    // 购物车列表
    const cartList = document.getElementById('cart-list');
    const cartItems = [{id: 1, name: '商品1', price: '100.00', quantity: 2}]; // 示例数据
    cartItems.forEach(item => {
        const li = document.createElement('li');
        li.textContent = `${item.name} - ￥${item.price} x ${item.quantity}`;
        cartList.appendChild(li);
    });
});